#include <QtGui>
#include "ui_MainWindow.h"

#ifndef MARKER_H
#define MARKER_H

class Marker : public QGraphicsItem
{
    Q_DECLARE_TR_FUNCTIONS(Marker)

public:
    enum Shape { Circle,Square,Triangle };

    Marker();

    void setOutlineColor(const QColor &color);
    QColor outlineColor() const;
    void setBackgroundColor(const QColor &color);
    QColor backgroundColor() const;
    void setShape(Shape shape);
    void setSize(short size);
    void getShape(Shape shape);

    QRectF boundingRect() const;
    QPainterPath shape() const;
    void paint(QPainter *painter,const QStyleOptionGraphicsItem *option, QWidget *widget);

protected:
    QVariant itemChange(GraphicsItemChange change,const QVariant &value);

private:
    QRectF Marker::outlineRect() const;
    int roundness(double size) const;

    QColor myBackgroundColor;
    QColor myOutlineColor;
    int mySize;
    Shape  myShape;

};

#endif // MARKER_H
